//
//  userdata.m
//  garbageclient
//
//  Created by Wang Wu on 11-9-6.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "userdata.h"

@implementation userdata

@synthesize strcurUserName;
@synthesize strcurUserPs;
@synthesize userNameArr;
@synthesize userPsArr;

#pragma mark NSCoding
- (void)encodeWithCoder:(NSCoder *)encoder {
    [encoder encodeObject:strcurUserName forKey:kCurUserNameKey];
    [encoder encodeObject:strcurUserPs forKey:kCurUserPwKey];
    [encoder encodeObject:userNameArr forKey:kUsersNameKey];
    [encoder encodeObject:userPsArr forKey:kUsersPwKey];
}
- (id)initWithCoder:(NSCoder *)decoder {
    self = [super init];
    if (self != nil) {
        self.strcurUserName = [decoder decodeObjectForKey:kCurUserNameKey];
        self.strcurUserPs = [decoder decodeObjectForKey:kCurUserPwKey];
        self.userNameArr = [decoder decodeObjectForKey:kUsersNameKey];
        self.userPsArr = [decoder decodeObjectForKey:kUsersPwKey];
    }
    return self;
}
#pragma mark -
#pragma mark NSCopying
- (id)copyWithZone:(NSZone *)zone {
    userdata *copy = [[[self class] allocWithZone: zone] init];
    copy.strcurUserName = [[self.strcurUserName copyWithZone:zone] autorelease];
    copy.strcurUserPs = [[self.strcurUserPs copyWithZone:zone] autorelease];
    copy.userNameArr = [[self.userNameArr copyWithZone:zone] autorelease];
    copy.userPsArr = [[self.userPsArr copyWithZone:zone] autorelease];
    
    return copy;
}

@end
